﻿using System;
using System.Linq;

namespace ConsoleApplication1
{
    static class MyNodeExtension
    {
        public static MyNode SetChilds(this MyNode root, params MyNode[] childs)
        {
            root.Childs = childs;
            return root;
        }
        public static MyNode SetChilds(this MyNode root, params Tuple<string, string>[] childs)
        {
            root.Childs = childs.Select(c => BuildLeaf(c)).ToArray();
            return root;
        }
        public static Leaf BuildLeaf(this Tuple<string, string> nameValue)
        {
            return new Leaf(nameValue.Item1, nameValue.Item2);
        }

    }
}